package faces;

import java.sql.SQLException;

import database.UsuarioDAO;

public class PaginaInicialFace {
	
	private String username;
	private String password;
	
	public String doLogin() {
		boolean b=false;
		try {
			b = UsuarioDAO.validateUser(username, password);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		if (b) {
			OfertasFace.setLogin(username);
			return "gotoPagInicial";
		} else {
			return "gotoLoginErro";		
		}
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

}
